using EFCoreBooks;
using Microsoft.AspNetCore.Mvc;

namespace WebApplication2.Controllers;

[ApiController]
[Route("[controller]")]
public class BookController : ControllerBase
{
    private readonly StoreDbContext dbContext;

    public BookController(StoreDbContext dbContext)
    {
        this.dbContext = dbContext;
    }

    [HttpGet]
    public int GetCount() => dbContext.Books.Count();
}